<template>
  <div>
    <van-field
      v-model="data"
      :type="type"
      :name="name"
      :label="label"
      :placeholder="placeholder"
    />
  </div>
</template>

<script>
export default {
  name: 'FieldNumber',
  props: {
    name: { type: String, default: undefined },
    type: { type: String, default: 'number' },
    value: { type: Number, default: 0 },
    label: { type: String, default: '' },
    placeholder: { type: String, default: '' },
    rules: { type: Array, default: () => [] }
  },

  data() {
    return {}
  },
  computed: {
    data: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', Number(val))
      }
    }
  },

  async created() {},

  methods: {}
}
</script>

<style type="text/css"></style>
